<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('产品分类表');
            $table->integer('parent_id')->nullable()->comment('父级ID');
            $table->tinyinteger('is_directory')->comment('是否目录');
            $table->string('name')->comment('分类名称');
            $table->string('content')->nullable()->comment('描述');
            $table->tinyinteger('sort')->default(0)->comment('排序');
            $table->integer('level')->comment('级别');
            $table->string('path')->comment('路径');
            $table->string('thum')->nullable()->comment('缩略图');
            $table->string('bz')->nullable()->comment('备注');
            $table->tinyinteger('is_show')->comment('是否显示');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categories');
    }
}
